# This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1113 -> 1.1114 # include/asm-parisc/unistd.h 1.8 -> 1.9 # include/asm-ppc64/unistd.h 1.20 -> 1.21 # include/asm-mips/unistd.h 1.6 -> 1.7 # include/asm-sparc/unistd.h 1.20 -> 1.21 # include/asm-sparc64/unistd.h 1.19 -> 1.20 # include/asm-ppc/unistd.h 1.23 -> 1.24 # include/asm-alpha/unistd.h 1.18 -> 1.19 # include/asm-m68k/unistd.h 1.8 -> 1.9 # include/asm-h8300/unistd.h 1.1 -> 1.2 # drivers/char/mem.c 1.37 -> 1.38 # include/asm-m68knommu/unistd.h 1.2 -> 1.3 # fs/proc/base.c 1.43 -> 1.44 # include/asm-i386/unistd.h 1.24 -> 1.25 # fs/fcntl.c 1.26 -> 1.27 # include/asm-x86_64/unistd.h 1.14 -> 1.15 # include/asm-mips64/unistd.h 1.5 -> 1.6 # include/asm-sh/unistd.h 1.5 -> 1.6 # include/asm-cris/unistd.h 1.10 -> 1.11 # include/asm-arm/unistd.h 1.16 -> 1.17 # include/asm-v850/unistd.h 1.6 -> 1.7 # include/asm-s390/unistd.h 1.16 -> 1.17 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/06/03 davidm@wailua.hpl.hp.com 1.1114 # Add force_successful_syscall_return() to remaining platforms. # -------------------------------------------- # diff -Nru a/drivers/char/mem.c b/drivers/char/mem.c --- a/drivers/char/mem.c Sun Jun 8 00:40:43 2003 +++ b/drivers/char/mem.c Sun Jun 8 00:40:43 2003 @@ -25,6 +25,7 @@ #include #include +#include #include #include diff -Nru a/fs/fcntl.c b/fs/fcntl.c --- a/fs/fcntl.c Sun Jun 8 00:40:43 2003 +++ b/fs/fcntl.c Sun Jun 8 00:40:43 2003 @@ -16,6 +16,7 @@ #include #include #include +#include extern int fcntl_setlease(unsigned int fd, struct file *filp, long arg); extern int fcntl_getlease(struct file *filp); diff -Nru a/fs/proc/base.c b/fs/proc/base.c --- a/fs/proc/base.c Sun Jun 8 00:40:43 2003 +++ b/fs/proc/base.c Sun Jun 8 00:40:43 2003 @@ -33,6 +33,8 @@ #include #include +#include + /* * For hysterical raisins we keep the same inumbers as in the old procfs. * Feel free to change the macro below - just keep the range distinct from diff -Nru a/include/asm-alpha/unistd.h b/include/asm-alpha/unistd.h --- a/include/asm-alpha/unistd.h Sun Jun 8 00:40:43 2003 +++ b/include/asm-alpha/unistd.h Sun Jun 8 00:40:43 2003 @@ -606,6 +606,8 @@ #endif /* __KERNEL_SYSCALLS__ */ +#ifdef __KERNEL__ + /* * "Conditional" syscalls * @@ -618,4 +620,25 @@ */ #define cond_syscall(x) asmlinkage long x() __attribute__((weak,alias("sys_ni_syscall"))); +/* + * System call handlers that, upon successful completion, need to return a negative value + * should call force_successful_syscall_return() right before returning. On architectures + * where the syscall convention provides for a separate error flag (e.g., alpha, ia64, + * ppc{,64}, sparc{,64}, possibly others), this macro can be used to ensure that the error + * flag will not get set. On architectures which do not support a separate error flag, + * the macro is a no-op and the spurious error condition needs to be filtered out by some + * other means (e.g., in user-level, by passing an extra argument to the syscall handler, + * or something along those lines). + * + * On alpha, we can clear the user's pt_regs->r0 to force a successful syscall. + * + * XXX TODO: if kernel-only threads do not have a dummy pt_regs structure at the top + * of the stack, this would cause kernel stack corruption. Either check + * first that we're not dealing with a kernel thread or change the kernel + * stacks to allocate a dummy pt_regs structure. + */ +#define alpha_task_regs(task) ((struct pt_regs *) ((long) task->thread_info + PAGE_SIZE) - 1) +#define force_successful_syscall_return() (alpha_task_regs(current)->r0 = 0) + +#endif /* __KERNEL__ */ #endif /* _ALPHA_UNISTD_H */ diff -Nru a/include/asm-arm/unistd.h b/include/asm-arm/unistd.h --- a/include/asm-arm/unistd.h Sun Jun 8 00:40:43 2003 +++ b/include/asm-arm/unistd.h Sun Jun 8 00:40:43 2003 @@ -483,6 +483,8 @@ #endif +#ifdef __KERNEL__ + /* * "Conditional" syscalls * @@ -491,4 +493,19 @@ */ #define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall"); +/* + * System call handlers that, upon successful completion, need to return a negative value + * should call force_successful_syscall_return() right before returning. On architectures + * where the syscall convention provides for a separate error flag (e.g., alpha, ia64, + * ppc{,64}, sparc{,64}, possibly others), this macro can be used to ensure that the error + * flag will not get set. On architectures which do not support a separate error flag, + * the macro is a no-op and the spurious error condition needs to be filtered out by some + * other means (e.g., in user-level, by passing an extra argument to the syscall handler, + * or something along those lines). + * + * On ARM, this is a no-op. + */ +#define force_successful_syscall_return() + +#endif /* __KERNEL__ */ #endif /* __ASM_ARM_UNISTD_H */ diff -Nru a/include/asm-cris/unistd.h b/include/asm-cris/unistd.h --- a/include/asm-cris/unistd.h Sun Jun 8 00:40:43 2003 +++ b/include/asm-cris/unistd.h Sun Jun 8 00:40:43 2003 @@ -381,6 +381,8 @@ #endif +#ifdef __KERNEL__ + /* * "Conditional" syscalls * @@ -389,4 +391,19 @@ */ #define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall"); +/* + * System call handlers that, upon successful completion, need to return a negative value + * should call force_successful_syscall_return() right before returning. On architectures + * where the syscall convention provides for a separate error flag (e.g., alpha, ia64, + * ppc{,64}, sparc{,64}, possibly others), this macro can be used to ensure that the error + * flag will not get set. On architectures which do not support a separate error flag, + * the macro is a no-op and the spurious error condition needs to be filtered out by some + * other means (e.g., in user-level, by passing an extra argument to the syscall handler, + * or something along those lines). + * + * On CRIS, this is a no-op. + */ +#define force_successful_syscall_return() + +#endif /* __KERNEL__ */ #endif /* _ASM_CRIS_UNISTD_H_ */ diff -Nru a/include/asm-h8300/unistd.h b/include/asm-h8300/unistd.h --- a/include/asm-h8300/unistd.h Sun Jun 8 00:40:43 2003 +++ b/include/asm-h8300/unistd.h Sun Jun 8 00:40:43 2003 @@ -451,6 +451,8 @@ #endif +#ifdef __KERNEL__ + /* * "Conditional" syscalls */ @@ -458,4 +460,19 @@ asm (".weak\t_" #name "\n" \ ".set\t_" #name ",_sys_ni_syscall"); +/* + * System call handlers that, upon successful completion, need to return a negative value + * should call force_successful_syscall_return() right before returning. On architectures + * where the syscall convention provides for a separate error flag (e.g., alpha, ia64, + * ppc{,64}, sparc{,64}, possibly others), this macro can be used to ensure that the error + * flag will not get set. On architectures which do not support a separate error flag, + * the macro is a no-op and the spurious error condition needs to be filtered out by some + * other means (e.g., in user-level, by passing an extra argument to the syscall handler, + * or something along those lines). + * + * On H8300, this is a no-op. + */ +#define force_successful_syscall_return() + +#endif /* __KERNEL__ */ #endif /* _ASM_H8300_UNISTD_H_ */ diff -Nru a/include/asm-i386/unistd.h b/include/asm-i386/unistd.h --- a/include/asm-i386/unistd.h Sun Jun 8 00:40:43 2003 +++ b/include/asm-i386/unistd.h Sun Jun 8 00:40:43 2003 @@ -393,6 +393,8 @@ #endif +#ifdef __KERNEL__ + /* * "Conditional" syscalls * @@ -401,4 +403,19 @@ */ #define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall"); +/* + * System call handlers that, upon successful completion, need to return a negative value + * should call force_successful_syscall_return() right before returning. On architectures + * where the syscall convention provides for a separate error flag (e.g., alpha, ia64, + * ppc{,64}, sparc{,64}, possibly others), this macro can be used to ensure that the error + * flag will not get set. On architectures which do not support a separate error flag, + * the macro is a no-op and the spurious error condition needs to be filtered out by some + * other means (e.g., in user-level, by passing an extra argument to the syscall handler, + * or something along those lines). + * + * On x86, this is a no-op. + */ +#define force_successful_syscall_return() + +#endif /* __KERNEL__ */ #endif /* _ASM_I386_UNISTD_H_ */ diff -Nru a/include/asm-m68k/unistd.h b/include/asm-m68k/unistd.h --- a/include/asm-m68k/unistd.h Sun Jun 8 00:40:43 2003 +++ b/include/asm-m68k/unistd.h Sun Jun 8 00:40:43 2003 @@ -365,6 +365,8 @@ #endif +#ifdef __KERNEL__ + /* * "Conditional" syscalls * @@ -373,4 +375,19 @@ */ #define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall"); +/* + * System call handlers that, upon successful completion, need to return a negative value + * should call force_successful_syscall_return() right before returning. On architectures + * where the syscall convention provides for a separate error flag (e.g., alpha, ia64, + * ppc{,64}, sparc{,64}, possibly others), this macro can be used to ensure that the error + * flag will not get set. On architectures which do not support a separate error flag, + * the macro is a no-op and the spurious error condition needs to be filtered out by some + * other means (e.g., in user-level, by passing an extra argument to the syscall handler, + * or something along those lines). + * + * On m68k, this is a no-op. + */ +#define force_successful_syscall_return() + +#endif /* __KERNEL__ */ #endif /* _ASM_M68K_UNISTD_H_ */ diff -Nru a/include/asm-m68knommu/unistd.h b/include/asm-m68knommu/unistd.h --- a/include/asm-m68knommu/unistd.h Sun Jun 8 00:40:43 2003 +++ b/include/asm-m68knommu/unistd.h Sun Jun 8 00:40:43 2003 @@ -409,6 +409,8 @@ #endif +#ifdef __KERNEL__ + /* * "Conditional" syscalls * @@ -417,4 +419,19 @@ */ #define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall"); +/* + * System call handlers that, upon successful completion, need to return a negative value + * should call force_successful_syscall_return() right before returning. On architectures + * where the syscall convention provides for a separate error flag (e.g., alpha, ia64, + * ppc{,64}, sparc{,64}, possibly others), this macro can be used to ensure that the error + * flag will not get set. On architectures which do not support a separate error flag, + * the macro is a no-op and the spurious error condition needs to be filtered out by some + * other means (e.g., in user-level, by passing an extra argument to the syscall handler, + * or something along those lines). + * + * On m68knommu, this is a no-op. + */ +#define force_successful_syscall_return() + +#endif /* __KERNEL__ */ #endif /* _ASM_M68K_UNISTD_H_ */ diff -Nru a/include/asm-mips/unistd.h b/include/asm-mips/unistd.h --- a/include/asm-mips/unistd.h Sun Jun 8 00:40:43 2003 +++ b/include/asm-mips/unistd.h Sun Jun 8 00:40:43 2003 @@ -481,6 +481,8 @@ #endif /* !defined (__KERNEL_SYSCALLS__) */ #endif /* !defined (_LANGUAGE_ASSEMBLY) */ +#ifdef __KERNEL__ + /* * "Conditional" syscalls * @@ -489,4 +491,19 @@ */ #define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall"); +/* + * System call handlers that, upon successful completion, need to return a negative value + * should call force_successful_syscall_return() right before returning. On architectures + * where the syscall convention provides for a separate error flag (e.g., alpha, ia64, + * ppc{,64}, sparc{,64}, possibly others), this macro can be used to ensure that the error + * flag will not get set. On architectures which do not support a separate error flag, + * the macro is a no-op and the spurious error condition needs to be filtered out by some + * other means (e.g., in user-level, by passing an extra argument to the syscall handler, + * or something along those lines). + * + * On MIPS, this is a no-op. + */ +#define force_successful_syscall_return() + +#endif /* __KERNEL__ */ #endif /* _ASM_UNISTD_H */ diff -Nru a/include/asm-mips64/unistd.h b/include/asm-mips64/unistd.h --- a/include/asm-mips64/unistd.h Sun Jun 8 00:40:43 2003 +++ b/include/asm-mips64/unistd.h Sun Jun 8 00:40:43 2003 @@ -807,6 +807,8 @@ #endif /* !defined (__KERNEL_SYSCALLS__) */ #endif /* !defined (_LANGUAGE_ASSEMBLY) */ +#ifdef __KERNEL__ + /* * "Conditional" syscalls * @@ -814,5 +816,21 @@ * but it doesn't work on all toolchains, so we just do it by hand */ #define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall"); + +/* + * System call handlers that, upon successful completion, need to return a negative value + * should call force_successful_syscall_return() right before returning. On architectures + * where the syscall convention provides for a separate error flag (e.g., alpha, ia64, + * ppc{,64}, sparc{,64}, possibly others), this macro can be used to ensure that the error + * flag will not get set. On architectures which do not support a separate error flag, + * the macro is a no-op and the spurious error condition needs to be filtered out by some + * other means (e.g., in user-level, by passing an extra argument to the syscall handler, + * or something along those lines). + * + * On MIPS64, this is a no-op. + */ +#define force_successful_syscall_return() + +#endif /* __KERNEL__ */ #endif /* _ASM_UNISTD_H */ diff -Nru a/include/asm-parisc/unistd.h b/include/asm-parisc/unistd.h --- a/include/asm-parisc/unistd.h Sun Jun 8 00:40:43 2003 +++ b/include/asm-parisc/unistd.h Sun Jun 8 00:40:43 2003 @@ -909,6 +909,8 @@ #undef STR +#ifdef __KERNEL__ + /* * "Conditional" syscalls * @@ -917,4 +919,19 @@ */ #define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall"); +/* + * System call handlers that, upon successful completion, need to return a negative value + * should call force_successful_syscall_return() right before returning. On architectures + * where the syscall convention provides for a separate error flag (e.g., alpha, ia64, + * ppc{,64}, sparc{,64}, possibly others), this macro can be used to ensure that the error + * flag will not get set. On architectures which do not support a separate error flag, + * the macro is a no-op and the spurious error condition needs to be filtered out by some + * other means (e.g., in user-level, by passing an extra argument to the syscall handler, + * or something along those lines). + * + * On PA-RISC, this is a no-op. + */ +#define force_successful_syscall_return() + +#endif /* __KERNEL__ */ #endif /* _ASM_PARISC_UNISTD_H_ */ diff -Nru a/include/asm-ppc/unistd.h b/include/asm-ppc/unistd.h --- a/include/asm-ppc/unistd.h Sun Jun 8 00:40:43 2003 +++ b/include/asm-ppc/unistd.h Sun Jun 8 00:40:43 2003 @@ -463,6 +463,21 @@ */ #define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall"); +/* + * System call handlers that, upon successful completion, need to return a negative value + * should call force_successful_syscall_return() right before returning. On architectures + * where the syscall convention provides for a separate error flag (e.g., alpha, ia64, + * ppc{,64}, sparc{,64}, possibly others), this macro can be used to ensure that the error + * flag will not get set. On architectures which do not support a separate error flag, + * the macro is a no-op and the spurious error condition needs to be filtered out by some + * other means (e.g., in user-level, by passing an extra argument to the syscall handler, + * or something along those lines). + * + * On PPC, the syscall error flag is returned via the SO bit in CR, but for now there is + * no way to force that bit to zero, so we do nothing here. + */ +#define force_successful_syscall_return() + #endif /* __KERNEL__ */ #endif /* _ASM_PPC_UNISTD_H_ */ diff -Nru a/include/asm-ppc64/unistd.h b/include/asm-ppc64/unistd.h --- a/include/asm-ppc64/unistd.h Sun Jun 8 00:40:43 2003 +++ b/include/asm-ppc64/unistd.h Sun Jun 8 00:40:43 2003 @@ -292,6 +292,8 @@ #endif /* __KERNEL_SYSCALLS__ */ +#ifdef __KERNEL__ + /* * "Conditional" syscalls * @@ -299,6 +301,23 @@ * but it doesn't work on all toolchains, so we just do it by hand */ #define cond_syscall(x) asm(".weak\t." #x "\n\t.set\t." #x ",.sys_ni_syscall"); + +/* + * System call handlers that, upon successful completion, need to return a negative value + * should call force_successful_syscall_return() right before returning. On architectures + * where the syscall convention provides for a separate error flag (e.g., alpha, ia64, + * ppc{,64}, sparc{,64}, possibly others), this macro can be used to ensure that the error + * flag will not get set. On architectures which do not support a separate error flag, + * the macro is a no-op and the spurious error condition needs to be filtered out by some + * other means (e.g., in user-level, by passing an extra argument to the syscall handler, + * or something along those lines). + * + * On PPC64, the syscall error flag is returned via the SO bit in CR, but for now there is + * no way to force that bit to zero, so we do nothing here. + */ +#define force_successful_syscall_return() + +#endif /* __KERNEL__ */ #endif /* __ASSEMBLY__ */ diff -Nru a/include/asm-s390/unistd.h b/include/asm-s390/unistd.h --- a/include/asm-s390/unistd.h Sun Jun 8 00:40:43 2003 +++ b/include/asm-s390/unistd.h Sun Jun 8 00:40:43 2003 @@ -537,6 +537,8 @@ #endif +#ifdef __KERNEL__ + /* * "Conditional" syscalls * @@ -544,5 +546,21 @@ * but it doesn't work on all toolchains, so we just do it by hand */ #define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall"); + +/* + * System call handlers that, upon successful completion, need to return a negative value + * should call force_successful_syscall_return() right before returning. On architectures + * where the syscall convention provides for a separate error flag (e.g., alpha, ia64, + * ppc{,64}, sparc{,64}, possibly others), this macro can be used to ensure that the error + * flag will not get set. On architectures which do not support a separate error flag, + * the macro is a no-op and the spurious error condition needs to be filtered out by some + * other means (e.g., in user-level, by passing an extra argument to the syscall handler, + * or something along those lines). + * + * On S390, this is a no-op. + */ +#define force_successful_syscall_return() + +#endif /* __KERNEL__ */ #endif /* _ASM_S390_UNISTD_H_ */ diff -Nru a/include/asm-sh/unistd.h b/include/asm-sh/unistd.h --- a/include/asm-sh/unistd.h Sun Jun 8 00:40:43 2003 +++ b/include/asm-sh/unistd.h Sun Jun 8 00:40:43 2003 @@ -360,6 +360,8 @@ #endif +#ifdef __KERNEL__ + /* * "Conditional" syscalls * @@ -368,4 +370,19 @@ */ #define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall"); +/* + * System call handlers that, upon successful completion, need to return a negative value + * should call force_successful_syscall_return() right before returning. On architectures + * where the syscall convention provides for a separate error flag (e.g., alpha, ia64, + * ppc{,64}, sparc{,64}, possibly others), this macro can be used to ensure that the error + * flag will not get set. On architectures which do not support a separate error flag, + * the macro is a no-op and the spurious error condition needs to be filtered out by some + * other means (e.g., in user-level, by passing an extra argument to the syscall handler, + * or something along those lines). + * + * On SH, this is a no-op. + */ +#define force_successful_syscall_return() + +#endif /* __KERNEL__ */ #endif /* __ASM_SH_UNISTD_H */ diff -Nru a/include/asm-sparc/unistd.h b/include/asm-sparc/unistd.h --- a/include/asm-sparc/unistd.h Sun Jun 8 00:40:43 2003 +++ b/include/asm-sparc/unistd.h Sun Jun 8 00:40:43 2003 @@ -428,6 +428,8 @@ #endif /* __KERNEL_SYSCALLS__ */ +#ifdef __KERNEL__ + /* * "Conditional" syscalls * @@ -436,4 +438,20 @@ */ #define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall"); +/* + * System call handlers that, upon successful completion, need to return a negative value + * should call force_successful_syscall_return() right before returning. On architectures + * where the syscall convention provides for a separate error flag (e.g., alpha, ia64, + * ppc{,64}, sparc{,64}, possibly others), this macro can be used to ensure that the error + * flag will not get set. On architectures which do not support a separate error flag, + * the macro is a no-op and the spurious error condition needs to be filtered out by some + * other means (e.g., in user-level, by passing an extra argument to the syscall handler, + * or something along those lines). + * + * On SPARC, the syscall error flag is returned via the carry condition code, but for now + * there is now way to force that bit to bo zero, so we do nothing here. + */ +#define force_successful_syscall_return() + +#endif /* __KERNEL__ */ #endif /* _SPARC_UNISTD_H */ diff -Nru a/include/asm-sparc64/unistd.h b/include/asm-sparc64/unistd.h --- a/include/asm-sparc64/unistd.h Sun Jun 8 00:40:43 2003 +++ b/include/asm-sparc64/unistd.h Sun Jun 8 00:40:43 2003 @@ -432,6 +432,8 @@ #define _SC_VERSION 8 #endif +#ifdef __KERNEL__ + /* * "Conditional" syscalls * @@ -440,4 +442,20 @@ */ #define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall"); +/* + * System call handlers that, upon successful completion, need to return a negative value + * should call force_successful_syscall_return() right before returning. On architectures + * where the syscall convention provides for a separate error flag (e.g., alpha, ia64, + * ppc{,64}, sparc{,64}, possibly others), this macro can be used to ensure that the error + * flag will not get set. On architectures which do not support a separate error flag, + * the macro is a no-op and the spurious error condition needs to be filtered out by some + * other means (e.g., in user-level, by passing an extra argument to the syscall handler, + * or something along those lines). + * + * On SPARC, the syscall error flag is returned via the carry condition code, but for now + * there is now way to force that bit to bo zero, so we do nothing here. + */ +#define force_successful_syscall_return() + +#endif /* __KERNEL__ */ #endif /* _SPARC64_UNISTD_H */ diff -Nru a/include/asm-v850/unistd.h b/include/asm-v850/unistd.h --- a/include/asm-v850/unistd.h Sun Jun 8 00:40:43 2003 +++ b/include/asm-v850/unistd.h Sun Jun 8 00:40:43 2003 @@ -419,6 +419,8 @@ #endif +#ifdef __KERNEL__ + /* * "Conditional" syscalls */ @@ -432,4 +434,19 @@ void name (void) __attribute__ ((weak, alias ("sys_ni_syscall"))); #endif +/* + * System call handlers that, upon successful completion, need to return a negative value + * should call force_successful_syscall_return() right before returning. On architectures + * where the syscall convention provides for a separate error flag (e.g., alpha, ia64, + * ppc{,64}, sparc{,64}, possibly others), this macro can be used to ensure that the error + * flag will not get set. On architectures which do not support a separate error flag, + * the macro is a no-op and the spurious error condition needs to be filtered out by some + * other means (e.g., in user-level, by passing an extra argument to the syscall handler, + * or something along those lines). + * + * On v850, this is a no-op. + */ +#define force_successful_syscall_return() + +#endif /* __KERNEL__ */ #endif /* __V850_UNISTD_H__ */ diff -Nru a/include/asm-x86_64/unistd.h b/include/asm-x86_64/unistd.h --- a/include/asm-x86_64/unistd.h Sun Jun 8 00:40:43 2003 +++ b/include/asm-x86_64/unistd.h Sun Jun 8 00:40:43 2003 @@ -701,6 +701,8 @@ #endif /* __NO_STUBS */ +#ifdef __KERNEL__ + /* * "Conditional" syscalls * @@ -709,4 +711,19 @@ */ #define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall"); +/* + * System call handlers that, upon successful completion, need to return a negative value + * should call force_successful_syscall_return() right before returning. On architectures + * where the syscall convention provides for a separate error flag (e.g., alpha, ia64, + * ppc{,64}, sparc{,64}, possibly others), this macro can be used to ensure that the error + * flag will not get set. On architectures which do not support a separate error flag, + * the macro is a no-op and the spurious error condition needs to be filtered out by some + * other means (e.g., in user-level, by passing an extra argument to the syscall handler, + * or something along those lines). + * + * On x86-64, this is a no-op. + */ +#define force_successful_syscall_return() + +#endif /* __KERNEL__ */ #endif